


<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display"%>
<%@ taglib uri="/WEB-INF/config/tld/fmt.tld" prefix="fmt"%>
<%@ taglib uri="http://ssh.org/selects" prefix="ssh"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path;
	String applicationPath = basePath + "/" + "application";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title></title>
		<link href="<%=path%>/css/jinmu_style.css" rel="stylesheet"
			type="text/css" />
		<script language="javascript" src="<%=path%>/js/util.js"></script>
		<base target="_self"/>
	</head>
	<body>

		<html:form styleId="yfApplyCostForm"
			action="listYfApplyCost.do?method=getYfApplyCostPartialList">
			<input type="hidden" id="totalPage" value="${totalPage}" />
			<table cellspacing="0" cellpadding="0" width="98%" align="center"
				border="0" class="margtb5">
				<tr>
					<td align="left" class="padl5 lan12">
						<img src="<%=path%>/images/img-11.gif" width="12" height="12"></img>
						费用申请单列表
					</td>
				</tr>
			</table>


			<table cellspacing="3" cellpadding="0" width="98%" align="center"
				border="0" class="kuang2 margtb5 hei12">
				<tr>


					<td width="10%" align="center">
						<bean:message
							key="com.application.yfapplycost.entity.yfapplycost.listpage.applyNo"
							bundle="yfapplycost" />：
					</td>
					<td width="80%">
						<html:text property="applyNo" />
						 &nbsp;&nbsp;&nbsp;
							<input class="buttonbg" style="cursor: hand" id="but_query"
							type="button"
							value="<bean:message key='com.manager.common.yfapplycost.query'  bundle="yfapplycost"/>"
							name="but_query" onClick="query();" />
					</td>
				</tr>

			</table>


			<table cellspacing="0" cellpadding="0" width="98%" align="center"
				border="0" class="margb5">
				<tr>
					<td>

						<fmt:bundle
							basename="com.application.yfapplycost.struts.ApplicationResources_yfapplycost">
							<display:table name="yfApplyCostList" class="simple"
								id="yfApplyCostTab" pagesize="15" partialList="true"
								style=" width:100%;" defaultorder="descending" size="resultSize"
								requestURI="listYfApplyCost.do?method=getYfApplyCostPartialList">
								<display:column title="选择" sortable="false"
									style=" width:5%; text-align:center;">
									<input type="hidden" id="${yfApplyCostTab.id}applyNo" name="${yfApplyCostTab.id}applyNo" value="${yfApplyCostTab.applyNo}"/>
									<input type="hidden" id="${yfApplyCostTab.id}projectName" name="${yfApplyCostTab.id}projectName" value="${yfApplyCostTab.projectName}"/>
									<input type="hidden" id="${yfApplyCostTab.id}projectNo" name="${yfApplyCostTab.id}projectNo" value="${yfApplyCostTab.projectNo}"/>
								<input type="checkbox" name='selectId' id="selectId" onclick="chooseApplyCost('${yfApplyCostTab.id}');"	 />
								</display:column>
									<display:column
									titleKey="com.application.yfapplycost.entity.yfapplycost.listpage.applyNo"
									sortable="false" style="width:5%; text-align:center;">
									  <a href="#" onclick="showView('${yfApplyCostTab.id}')">${yfApplyCostTab.applyNo}</a> 
									</display:column>
									 <display:column title="项目名称"  property="projectName"
									sortable="false" style="width:10%; text-align:center;"/>
						
										<display:column property="rname"
									titleKey="com.application.yfapplycost.entity.yfapplycost.listpage.operateid"
									sortable="false" style="width:5%; text-align:center;" />
	                           <display:column property="org"
									titleKey="com.application.yfapplycost.entity.yfapplycost.listpage.org"
									sortable="false" style="width:5%; text-align:center;" />

							

								<display:column property="projectNo"
									titleKey="com.application.yfapplycost.entity.yfapplycost.listpage.projectNo"
									sortable="false" style="width:5%; text-align:center;" />

							

								<display:column property="applyDate" format="{0,date,yyyy-MM-dd}"
									titleKey="com.application.yfapplycost.entity.yfapplycost.listpage.applyDate"
									sortable="false" style="width:5%; text-align:center;" />

								<display:column property="applyMoney"
									titleKey="com.application.yfapplycost.entity.yfapplycost.listpage.applyMoney"
									sortable="false" style="width:5%; text-align:center;" />

								<display:column property="feeType"
									titleKey="com.application.yfapplycost.entity.yfapplycost.listpage.feeType"
									sortable="false" style="width:5%; text-align:center;" decorator="com.manager.commons.DictCodeColumnDecorator"
									dictCode="FEE_TYPE"/>

							
							</display:table>
						</fmt:bundle>
					</td>
				</tr>
			</table>

		</html:form>
	</body>
</html>
<script>

function query(){
	document.forms[0].action="popuSelectApplyCostList.do?method=popuSelectApplyCostList";
	document.forms[0].submit();
}

//新增
function addYfApplyCost(){
    document.forms[0].action="toAddYfApplyCost.do?method=toAddYfApplyCost";
	document.forms[0].submit();
}

//修改
function modifyYfApplyCost(){
    var result = validateSelect();
	if(result==0){
		alert("请选择一条记录！");
		return;
	}else if(result>1){
	        alert("一次只能编辑一条记录！");
		return;
	}else{
		document.forms[0].action="toUpdateYfApplyCost.do?method=toUpdateYfApplyCost";
	        document.forms[0].submit();
	}
	
}

//删除
function delYfApplyCost()
{
	var ids = getSelectedIds('id');
	if( ids=="" )
	{
		alert("请选择一条记录！");
		return false;
	}
	if( confirm("是否要删除所选的信息？") )
	{
		document.forms[0].action="deleteYfApplyCost.do?method=deleteYfApplyCost&ids=" + ids;
		document.forms[0].submit();
	}
}
	
	
function validateSelect(){ 
    var count = 0;
    var jysBox = $s("id");
    for(var i=0;i<jysBox.length;i++){
		if(jysBox[i].checked){
        	count++;
		}
	}
    return count;
}

//查看
function view(){
	var result = validateSelect();
	if(result==0){
		alert("请选择一条记录！");
		return;
	}else if(result>1){
	    alert("一次只能查看一条记录！");
		return;
	}else{
		document.forms[0].action="viewYfApplyCost.do?method=viewYfApplyCost";
	    document.forms[0].submit();
	}
}

//查看
function showView(id){ 
    document.forms[0].action="viewYfApplyCost.do?method=viewYfApplyCost&id=" + id;
	document.forms[0].submit();

}
//全选   
function checkAll()   
{ 
  
   var chk=document.getElementsByName("id");   
   for(var i=0;i<chk.length;i++)   
   { 
     if($('checkall').checked){
     	chk(i).checked=true; 
     }else{
        chk(i).checked=false; 
     } 
       
 }
  
}   



this.returnValue = new Array();
function chooseApplyCost(id){
   var applyNo = id+'applyNo';
   var projectName = id+'projectName';
   var projectNo = id+'projectNo';
   this.returnValue["applyNo"]= $(applyNo).value;
   this.returnValue["projectName"]= $(projectName).value;
   this.returnValue["projectNo"]= $(projectNo).value;
   window.close();
}
</script>
